package com.example.demo.modules.databaseui.servceImp;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.modules.databaseui.entity.Databse;
import com.example.demo.modules.databaseui.mapper.DatabseMapper;
import com.example.demo.modules.databaseui.service.DatabseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;


@Service
public class DatabseServiceImpl extends ServiceImpl<DatabseMapper, Databse> implements DatabseService {

    @Autowired
    private DatabseMapper databseMapper;

    //查询所有
    @Override
    public List<Databse> listAll() {
        List<Databse> databses = this.list();
        return databses;
    }

    //条件查询
    @Override
    public Databse listOne(Long id) {
        Databse databse = this.getById(id);
        return databse;
    }

    //保存
    @Override
    public int insert(Databse databse){
        return databseMapper.insert(databse);

    }

}